package com.common.domain.dto;

import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * @author liuxuhuang
 * @date 2023年04月16日 23:00
 * @desc 获取访客记录查询条件
 */
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@EqualsAndHashCode
@ToString
@Setter
public class AddGuestRecordDTO {
    /**
     * id
     */
    private int id;

    /**
     * 姓名
     */
    @NotBlank(message = "姓名不能为空")
    private String name;
    /**
     * 手机号
     */
    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1[3,4,5,6,7,8,9][0-9]{9}$", message = "手机号格式错误")
    private String phone;
    /**
     * 身份
     */
    @NotBlank(message = "身份不能为空")
    private String identity;

    /**
     * 进入时间
     */
    @NotBlank(message = "进入时间不能为空")
    private String enterTime;
    /**
     * 备注，原因
     */
    private String season;

    public int getId() {
        return id;
    }

    public String getName() {
        return name.replaceAll(" ", "");
    }

    public String getPhone() {
        return phone.replaceAll(" ", "");
    }

    public String getIdentity() {
        return identity.replaceAll(" ", "");
    }

    public String getEnterTime() {
        return enterTime;
    }

    public String getSeason() {
        return season;
    }
}
